﻿#include "UOneListUMG.h"

#include "Blueprint/WidgetLayoutLibrary.h"
#include "ListLibrary/ListUIStyle.h"

UOneListUMG::UOneListUMG()
{
}

TSharedRef<SWidget> UOneListUMG::RebuildWidget()
{
	OneList = SNew(SOneList);
	return OneList.ToSharedRef();
}

const FText UOneListUMG::GetPaletteCategory()
{
	return FText::FromString(TEXT("小辉辉"));
}

//资源释放
void UOneListUMG::ReleaseSlateResources(bool bReleaseChildren)
{
	Super::ReleaseSlateResources(bReleaseChildren);
	OneList.Reset();
}

void UOneListUMG::UpDataList(int width,TMap<FString,float> ListData)
{
	OneList->UpDataList(width,ListData);
}

//更新UI
void UOneListUMG::SynchronizeProperties()
{
	Super::SynchronizeProperties();
	OneList->UpDataTitleName(Title);
	OneList->ShowYuan = ShowYuan;
	
}